#!/usr/bin/env python
# -*- coding:utf-8 -*-
"""
# @FileName  :main.py.py
# @Time      :2024/3/27 16:19
# @Author    :Toliong toliong@foxmail.com
"""
from fastapi import FastAPI
from pydantic import BaseModel
from createllm import CreateLLM
import uvicorn

app = FastAPI()


class InputString(BaseModel):
    text: str


@app.post("/inputText")
async def process_string(data: InputString):
    processed_text = data.text
    model = CreateLLM.LLMModel("CreateLLMModel")
    result = model.generate(processed_text)
    return {"processed_text": result}


if __name__ == "__main__":
    uvicorn.run(app="main:app", host='0.0.0.0', reload=True)
